package com.atguigu.ucenterservice.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @program: guli_parent
 * @description:
 * @author: xuejingjing
 * @create: 2021-01-02 00:31
 **/


//@Component   工具类
public class ConstantWxUtils implements InitializingBean {
    /**
     * 读取配置文件里面的值（内容）
     */
    @Value("${wx.open.app_id}")
    private String appId;


    //Could not resolve placeholder 'wx.open.app_id' in value "${wx.open.app_id}"


    @Value("${wx.open.app_secret}")
    private String appSecret;

    @Value("${wx.open.redirect_uri}")
    private String redirectUri;

    public static String WX_OPEN_APP_ID;
    public static String WX_OPEN_APP_SECRET;
    public static String WX_OPEN_REDIRECT_URL;


    @Override
    public void afterPropertiesSet() throws Exception {
        WX_OPEN_APP_ID = appId;
        WX_OPEN_APP_SECRET =appSecret;
        WX_OPEN_REDIRECT_URL = redirectUri;
    }
}
